package lagouhomework;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.List;

public class manageSys {
    public static void main(String[] args){
        List<message> l=new LinkedList<message>();
        addMsg msg=new addMsg();
        check ck=new check();
        manageSys ms=new manageSys();
        change cg=new change();
        delete dl=new delete();
        message s=new message();
        Scanner sc=new Scanner(System.in);
        while(true){
            System.out.println("请输入要进行的操作：查询 增加 修改 删除 查看所有 结束");
        String go= sc.next();
        if("查询".equals(go)){
            ck.check(l);
        }else if("增加".equals(go)){
            msg.addMsg(l);
        }else if("修改".equals(go)){
            cg.change(l);
        }else if("删除".equals(go)){
            dl.delete(l);
        }else if("查看所有".equals(go)){

            System.out.println("学号\t姓名\t年龄");
            for (int i = 0; i < l.size(); i++) {
                     s=l.get(i);
                    System.out.println(s.getNum()+"\t"+s.getName()+"\t"+s.getAge()+"岁\t");

            }
        }else if("结束".equals(go)){
            break;
        }else{
            System.out.println("请输入正确的指令");
        }
        }
    }
}
